import { Component } from '@angular/core';
import { Platform, NavController, AlertController,NavParams } from 'ionic-angular';
import { DocumentsPage } from '../documents/documents';//工程详细页

import { PubApi } from '../../providers/pubapi';



@Component({
    selector: 'page-engineersdetail',
    templateUrl: 'engineersdetail.html'
})


export class engineersdetailPage {

      public engineer: any;
      public engineerDetail:any;
      public key:any;
    constructor(public platform: Platform, public navParams: NavParams,public navCtrl:NavController, public pubapi: PubApi) {
var that=this;
        platform.ready().then(() => {

             this.engineer = navParams.get("engineer");
           
              this.pubapi.get("/EngineerCreate/MobileGetAllByName?name="+this.engineer, function (res) {
            var result = res.data;
            that.engineerDetail = result[0];
            that.key=result[0].Key;


        })
            // this.engineerDetail={name:"黄浦江一段工程",company:"山海河道管理公司"};


        });

    }


    ionViewDidEnter() {


    }

    itemSelected(item)
    {
            console.log(item);

    }


     openDocumentsPage (item) {
         var that =this;
        this.navCtrl.push(DocumentsPage, {
            key:that.key
        });

    }
}
